#ifndef _DRIVER_XXX_H_
#define _DRIVER_XXX_H_

#include <stdio.h>
#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
extern "C"{
#endif



/**
 * @brief xxx handle structure definition
 */
typedef struct xxx_handle_s
{
    uint8_t (*iic_init)(void);                                                 /**< point to an iic_init function address */
    uint8_t (*iic_deinit)(void);                                               /**< point to an iic_deinit function address */
    uint8_t (*iic_read_cmd)(uint8_t addr, uint8_t *buf, uint16_t len);         /**< point to an iic_read_cmd function address */
    uint8_t (*iic_write_cmd)(uint8_t addr, uint8_t *buf, uint16_t len);        /**< point to an iic_write_cmd function address */
    void (*delay_ms)(uint32_t ms);                                             /**< point to a delay_ms function address */
    void (*debug_print)(const char *const fmt, ...);                           /**< point to a debug_print function address */
    uint8_t inited;                                                            /**< inited flag */
} xxx_handle_t;

/**
 * @brief xxx information structure definition
 */
typedef struct xxx_info_s
{
    char chip_name[32];                /**< chip name */
    char manufacturer_name[32];        /**< manufacturer name */
    char interface[8];                 /**< chip interface name */
    float supply_voltage_min_v;        /**< chip min supply voltage */
    float supply_voltage_max_v;        /**< chip max supply voltage */
    float max_current_ma;              /**< chip max current */
    float temperature_min;             /**< chip min operating temperature */
    float temperature_max;             /**< chip max operating temperature */
    uint32_t driver_version;           /**< driver version */
} xxx_info_t;



#define DRIVER_XXX_LINK_INIT(HANDLE, STRUCTURE)      memset(HANDLE, 0, sizeof(STRUCTURE))
#define DRIVER_XXX_LINK(HANDLE, FUN_P, FUC)        (HANDLE)->(FUN_P) = FUC


uint8_t xxx_info(xxx_info_t *info);
uint8_t xxx_init(xxx_handle_t *handle);
uint8_t xxx_deinit(xxx_handle_t *handle);

uint8_t xxx_read(xxx_handle_t *handle, uint32_t *temperature_raw);


#ifdef __cplusplus
}
#endif

#endif
